<?php
$this->breadcrumbs=array(
    'Quản trị'=>array('/admin'),
    'Menu'=>array('index'),
    'Danh sách menu',
);

$this->menu=array(
    array('label'=>'Danh sách menu', 'url'=>array('index')),
    array('label'=>'Tạo menu', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('hierarchy-grid', {
		data: $(this).serialize()
	});
	return false;
});
");

?>

<h1>Danh sách menu</h1>

<?php $this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'hierarchy-grid',
    'dataProvider'=>$model->search(),
    //'filter'=>$model,
    'columns'=>array(
//        'id',
        'sort',
        array('name'=>'parent','value'=>'$data->getparent ? $data->getparent->title : ""'),
        'title',
        'router',
        'url',
        array(
            'class'=>'CButtonColumn',
            'template'=>"{update},{delete}"
        ),
    ),
)); ?>
